<?php
namespace decorator;

//装饰角色
class ClothesDecorator implements ComponentInterface
{
    protected $_component;

    public function __construct(ComponentInterface $component)
    {
        $this->_component = $component;
    }

    public function show() 
    {
        if( ! empty($this->_component)) {
            $this->_component->show(); //增加功能
        }
    }
}